<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<table class="tablelist">
       <thead>
	        <tr>
		        <th width="50%" align="center">基本信息</th>
		        <th width="10%" align="center" class="align-center-go">价格</th>
		        <th width="10%" align="center" class="align-center-go">数量</th>
		        <th width="10%" align="center" class="align-center-go">金额</th>
		        <th width="20%" align="center" class="align-center-go">操作</th>
		    </tr>
        </thead>
        <tbody>
         <c:choose>
		     <c:when test="${list.size()>0 }">
			  <c:forEach items="${list}" var="vo" varStatus="status">
					<tr>
				        <td colspan="5" class="pda">
							<table class="item-order">
								<tbody>
								<% %>
								 <tr>
									<td colspan="2" class="order_td">
										订单号:${vo.orderSn }&nbsp;&nbsp;&nbsp;下单时间：<f:formatDate value="${vo.addTime }" pattern="yyyy-MM-dd HH:mm:sss"/>
										&nbsp;&nbsp;状态：
										 <c:choose>
										   <c:when test="${vo.shopState eq 0 }">未支付</c:when>
										    <c:when test="${vo.shopState eq 1 }">已支付</c:when>
										     <c:when test="${vo.shopState eq 2 }">已确认，已发货</c:when>
										      <c:when test="${vo.shopState eq -1 }">已取消</c:when>
										 </c:choose>
										 &nbsp;&nbsp;收货地址：${vo.province}${vo.city}${vo.area}${vo.address}
										 &nbsp;&nbsp;收货人：${vo.userName }&nbsp;&nbsp;手机号码：${vo.phone }
									</td>
								</tr>
									<tr>
										<td width="80%">
											<table class="order-item-go" >
												<tbody>
												  <c:forEach var="ch" items="${vo.shopOrderGoods }">
												     <tr>
														<td width="50%" style="padding: 5px;">
															<img  onerror="this.src='${pathUrl }/public/images/nopic.png'"  src="${pathUrl}${ch.goodsImg}" class="goods"  onerror="this.src='${pathUrl }/public/images/nopic.png'" >
																<p style="font-weight: bold;">
																   ${ch.goodsName}
																</p>
																<p>货号：${ch.goodsSn }</p>
																<p>分类：${ch.catalogName }</p>
														</td>
														<td width="10%" align="center">${ch.price}</td>
														<td width="10%" align="center">${ch.goNum }</td>
														<td width="10%" align="center">${ch.totalPrice }</td>
													</tr>
												  </c:forEach>
											</tbody>
										  </table>
										</td>
										<td width="20%" style="text-align: center!important;">
										      <c:choose>
										        <c:when test="${vo.shopState eq 1 }">
										        	<a href="javascript:;" onclick="cancel(${vo.id })" class="tablelink">取消</a>
											 		<a href="javascript:;" onclick="confirmYes(${vo.id })" class="tablelink">确认</a>
										        </c:when>
										        <c:when test="${vo.shopState eq -1 }">
										            <a href="javascript:;" onclick="confirmYes(${vo.id })" class="tablelink">确认</a>
										        </c:when>
										        <c:when test="${vo.shopState eq -2 }">已发货</c:when>
										      </c:choose>
										</td>
									</tr>
								</tbody>
							</table>
				         </td>
				    </tr>
			  </c:forEach>
			</c:when>  
			<c:otherwise>
		      <tr>
		        <td colspan="5">暂无数据！</td>
		      </tr>
			</c:otherwise>
        </c:choose>	
        </tbody>
    </table>
    <input type="hidden" id="pageNum" name="pageNum" value="${pageNum }"/>
    <input type="hidden" id="pages" name="pages" value="${pages }"/>
     <input type="hidden" id="total" name="total" value="${total }"/>
      <input type="hidden" id="pageSize" name="pageSize" value="${pageSize }"/>
    